package model;

import java.util.HashMap;

public class TraitementThreadVie implements Runnable {
	private Object[] ar;
	private static HashMap<Coordonnee, Cellule> mapTps1;
	private static HashMap<Coordonnee, Cellule> mapTps2;
	private HashMap<Coordonnee, Integer> mapDonneVie;
	private int debut = 0;
	private int fin = 0;
	private int nbVoisine = 8;

	public TraitementThreadVie(Object[] ar, HashMap<Coordonnee, Cellule> mapTps1,
			HashMap<Coordonnee, Cellule> mapTps2,
			HashMap<Coordonnee, Integer> mapDonneVie, int debut, int fin,
			int nbVoisine) {
		this.ar = ar;
		TraitementThreadVie.mapTps1 = mapTps1;
		TraitementThreadVie.mapTps2 = mapTps2;
		this.mapDonneVie = mapDonneVie;
		this.debut = debut;
		this.fin = fin;
		this.nbVoisine = nbVoisine;
	}

	public void run() {
		for (int i = debut; i <= fin; i++) {
			Cellule c = (Cellule) ar[i];
			c.traitement(mapTps1, mapTps2, mapDonneVie, nbVoisine);
		}
	}

}
